//
//  DetailOfPhotograph.m
//  LoveOfPet
//
//  Created by 芦彬 on 15/11/15.
//  Copyright © 2015年 孔维. All rights reserved.
//

#import "DetailOfPhotograph.h"

@implementation DetailOfPhotograph

- (void)dealloc{
    [_info release];
    [_pets release];
    [super dealloc];
}

- (instancetype)initWithDictionary:(NSDictionary *)dic{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

+ (DetailOfPhotograph *)detailOfPhotographWithDictionary:(NSDictionary *)dictionary{
    DetailOfPhotograph *detailOfPhotograph = [[DetailOfPhotograph alloc]initWithDictionary:dictionary];
    return [detailOfPhotograph autorelease];
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}

- (void)setValue:(id)value forKey:(NSString *)key
{
    if ([key isEqualToString:@"data"]) {
        self.info = [Info infoWithDictionary:[value objectForKey:@"info"]];
        self.pets = [Pets petsWithDictionary:[[value objectForKey:@"pets"] objectAtIndex:0]];
    }else{
        [super setValue:value forKey:key];
    }
}


@end
